<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="embroot.css">
<TITLE>
Serialized representation of EXDR terms
</TITLE>
</HEAD>
<BODY >
<A HREF="embroot050.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="embroot049.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc104">9.2</A>&nbsp;&nbsp;Serialized representation of EXDR terms</H2>

The following is the specification of what is actually send over the
communication channels.
This is all the information needed to create new language mappings
for EXDR terms. This definition corresponds to EXDR_VERSION 2:
<BLOCKQUOTE CLASS="quote"><PRE CLASS="verbatim">
ExdrTerm      ::=   'V' Version CompactFlag? Term
CompactFlag   ::=   'C'
Term          ::=   (Integer|Double|String|List|Nil|Struct|Variable)
Integer       ::=   ('B' &lt;byte&gt; | 'I' XDR_int | 'J' XDR_long)
Double        ::=   'D' XDR_double
String        ::=   ('S' Length &lt;byte&gt;* | 'R' Index)
List          ::=   '[' Term (List|Nil)
Nil           ::=   ']'
Struct        ::=   'F' Arity String Term*
Variable      ::=   '_'
Length        ::=   XDR_nat
Index         ::=   XDR_nat
Arity         ::=   XDR_nat
Version       ::=   &lt;byte&gt;
XDR_int       ::=   &lt;4 bytes, msb first&gt;
XDR_long      ::=   &lt;8 bytes, msb first&gt;
XDR_double    ::=   &lt;8 bytes, ieee double, exponent first&gt;
XDR_nat       ::=   ( &lt;8 bits: 1 + seven bits unsigned value&gt;
                    | XDR_int )                    // &gt;= 0
</PRE></BLOCKQUOTE>
The version byte is 1 or 2. EXDR version 1 encodings are also valid
version 2 encodings, and version version 2 decoders can read
version 1 encoded terms.<BR>
<BR>
XDR_long, XDR_int and byte are all signed integers in two's complement
representation.<BR>
<BR>
The string reference code R means that the string is the same as the
Index'th S-encoded string that occurred in the EXDR term earlier.
The presence of the CompactFlag C in the header indicates that the term
may actually contain such string references. If the flag is absent, the
term does not contain any.<BR>
<BR>
<HR>
<A HREF="embroot050.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="embroot049.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
</BODY>
</HTML>
